| Total Complexity | 4 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import { NameInputComponent } from './../fragments/name-input/name-input.component'; |
||
| 24 | |||
| 25 | @Injectable({ |
||
| 26 | providedIn: 'root' |
||
| 27 | }) |
||
| 28 | export class KeyboardService { |
||
| 29 | constructor() { |
||
| 30 | window.keyboard = this; |
||
| 31 | } |
||
| 32 | |||
| 33 | registerKeyboard(keyboard: KeyboardsComponent) { |
||
| 34 | this.keyboard = keyboard; |
||
| 35 | } |
||
| 36 | |||
| 37 | deregisterKeyboard() { |
||
| 38 | this.keyboard = null; |
||
| 39 | } |
||
| 40 | |||
| 41 | open(input: NameInputComponent) { |
||
| 42 | if (this.keyboard !== null) |
||
| 43 | this.keyboard.open(input); |
||
| 44 | } |
||
| 45 | |||
| 46 | keyboard: KeyboardsComponent | null = null; |
||
| 47 | } |
||
| 48 |